import Vue from "vue";
import VueRouter from "vue-router";
import Ul_Router from "@/views/Ul_Router";
import Contacts from "@/views/Contacts";
import About from "@/views/About";
import All_Contacts from "@/views/son/All_Contacts";
import Alice from "@/views/son/Alice";
import Bob from "@/views/son/Bob";
import Blog from "@/views/son/grandson/Blog";
import Fax from "@/views/son/grandson/Fax";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/ul_router",
  },
  {
    path: "/ul_router",
    component: Ul_Router,
  },
  {
    path: "/contacts",
    component: Contacts,
    children: [
      {
        path: "all_contacts",
        name: "All_Contacts",
        component: All_Contacts,
      },
      {
        path: "alice",
        name: "Alice",
        component: Alice,
      },
      {
        path: "bob",
        name: "Bob",
        component: Bob,
        children: [
          {
            path: "blog",
            component: Blog,
          },
          {
            path: "fax",
            component: Fax,
          },
        ],
      },
    ],
  },
  {
    path: "/about",
    component: About,
  },
];

const router = new VueRouter({
  routes,
});

export default router;
